<%@ page language="java" pageEncoding="UTF-8" %>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="fp" uri="/fp-tags" %>

<%@ include file="/common/head.jsp"%>
<%@ include file="/common/left.jsp"%>
<%@ include file="/common/righthead.jsp"%>

<script type="text/javascript">

	$(document).ready(function() {
		$("#mainForm").validate();
	});

	function clickBtn(action,event,id){
		switch(action){
		case "search":
			  $("#mainForm").attr("action", "publish-info.action");
			  break;
		case "clear":
			  $("#mainForm").attr("action", "publish-info.action?clean=true");
			  break;
		case "create":
			  popup(event, 'publish-info!input.action', 'width:710;height:430;');
			  return;

		case "edit":
			  popup(event, "publish-info!input.action?infoPublishId="+id, "width:710;height:430;");
			  return;	

		case "delete":
			$("#mainForm").attr("action", "publish-info!delete.action?infoPublishId="+id);
			break;				  
		}

		$("#mainForm").submit();
	}
</script>
	
<div class="content">  
  <div class="pageTitle">Publish information</div>
  <script>menuSelected = "FUN003";</script>
  
  <div class="form1">
  <s:form id="mainForm" name="mainForm" action="publish-info.action" method="post">
  
    <table border="0" cellspacing="0" cellpadding="0">
	      <tr>
	        <td class="sep" ><img src="../images/spacer.gif" style="width:180px;" /></td>
	        <td class="sep" ><img src="../images/spacer.gif" style="width:180px;" /></td>
	        <td class="sep" ><img src="../images/spacer.gif" style="width:180px;" /></td>
	        <td class="sep" ><img src="../images/spacer.gif" style="width:180px;" /></td>
	        <td class="sep sep2" ><img src="../images/spacer.gif" /></td>
	      </tr>
	      <tr>
	        <td><label class="fLabel" >发布类型</label>
	          <div class="fField">
		            <s:select cssClass="inputSelect" cssStyle="width:155px" name="infoPublish.type" 
		            		  list="parameterManager.getByCode('PUBLISH_TYPE')" listKey="value" listValue="label"
		            		  headerKey="" headerValue="-- Select --">
		            </s:select>
	          </div></td>
	        <td><label class="fLabel" >标题</label>
	          <div class="fField">
	             <s:textfield name="infoPublish.title" cssStyle="width:150px" />
	          </div></td>
	        <td><label class="fLabel" >发布信息</label>
	          <div class="fField">
	            <s:textfield name="infoPublish.content" cssStyle="width:150px" />
	          </div></td>
	          
	        <td><label class="fLabel" >修改日期From</label>
	          <div class="fField">
	            <input type="text" name="", class="inputText" style="width:150px">
	          </div></td>
	          
	          <td><label class="fLabel" >修改日期To</label>
	          <div class="fField">
	            <input type="text" name="", class="inputText" style="width:150px">
	          </div></td>
	      </tr>

        </table>
        
	    <div class="btnSet btnSetTypeB">
		      <div class="left" >
		        <div class="button" >
		          <div class="left" >
		            <div class="right" >
		              <input class="inputButton" type="button" id="searchBtn" name="search" value="Search" onclick="clickBtn('search');"/>
		            </div>
		          </div>
		        </div>
		        
		        <div class="button" >
		          <div class="left" >
		            <div class="right" >
		              <input class="inputButton" type="button" id="clearBtn" name="clear" value="Clear" onclick="clickBtn('clear');"/>
		            </div>
		          </div>
		        </div>
		        
		        <div class="button" >
		          <div class="left" >
		            <div class="right" >
		              <input class="inputButton" type="button" id="createBtn" name="create" value="Create" onclick="clickBtn('create',event)"/>
		            </div>
		          </div>
		        </div>
		        
	      </div>
      	</div>
    
		<s:if test="%{page!=null&&page.result!=null&&page.result.size()!=0}">
		   <div class="sList">
		     <table width="100%" cellspacing="0" cellpadding="0" border="0" class="sTable">
		       <tbody><tr>
		         <td class="sTh t"><s:property value="%{getText('COMMON_PUBLISH_TITLE')}" escape="true" /></td>
		         <td class="sTh t"><s:property value="%{getText('COMMON_PUBLISH_PHONE')}" escape="true" /></td>
		         <td class="sTh t"><s:property value="%{getText('COMMON_PUBLISH_QQ')}" escape="true" /></td>
		         <td class="sTh t"><s:property value="%{getText('COMMON_PUBLISH_TRADE')}" escape="true" /></td>
		         <td class="sTh t"><s:property value="%{getText('COMMON_PUBLISH_ADDRESS')}" escape="true" /></td>
		         <td class="sTh t"><s:property value="%{getText('COMMON_PUBLISH_CONTENT')}" escape="true" /></td>
		         <td class="sTh t"><s:property value="%{getText('COMMON_OPERATION')}" escape="true" /></td>
		       </tr>
		       
		       <s:iterator value="page.result" var="publishInfo" status="st">
      
		       	  <s:set var="trClass" value="'sRow1'"></s:set>
		    	  <s:if test="#st.index%2==0">
		       	 		<s:set var="trClass" value="'sRow2'"></s:set>
			       	 <s:else>
			       	    <s:set var="trClass" value="'sRow1'"></s:set>
			       	 </s:else>
				  </s:if>
				  
			      <tr class="<s:property value="#trClass"/>">
	      
			         <td class="sCell"><a href="#" onclick="clickBtn('edit',event,'<s:property value='#publishInfo.id'/>');"><s:property value="#publishInfo.title"/></a></td>
			         <td class="sCell"><s:property value="#publishInfo.contactWay"/></td>
			         <td class="sCell"><s:property value="#publishInfo.user.name"/></td>
			         <td class="sCell"><s:property value="#publishInfo.trade.name"/></td>
			         <td class="sCell"><s:property value="#publishInfo.area.name"/></td>
			         <td class="sCell"><s:property value="#publishInfo.content"/></td>
			         
			         <td class="sCell buttonCell">
					    <div class="btnSet btnSetTypeB" style="height:5px;">
					       <div class="left" >
						        <div class="button sbtn" >
						          <div class="left" >
						            <div class="right" >
						              <input class="inputButton" type="button" id="clearBtn" name="clear" value="Edit" onclick="clickBtn('edit',event,'<s:property value='#publishInfo.id'/>');"/>
						            </div>
						          </div>
						        </div>
						        <div class="button sbtn" >
						          <div class="left" >
						            <div class="right" >
						              <input class="inputButton" type="button" id="createBtn" name="create" value="Delete" onclick="clickBtn('delete',event,'<s:property value='#publishInfo.id'/>');"/>
						            </div>
						          </div>
						       </div>
					      </div>
				      	</div>	
			         </td>
		      	 </tr>		       
		       </s:iterator>
		     </tbody>
		     </table>
		   </div>
		   <fp:paging page="page"></fp:paging>
		</s:if> 
	
	</s:form> 
	</div>

</div>
<%@ include file="/common/foot.jsp" %>